(1) Field of the Invention
The present invention relates to an apparatus and a method for processing an image, and more particularly to an image processing apparatus and method which are arranged to read an input image on a predetermined scale, process the image, and generate an output image.
(2) Description of the Related Art
For a multimedia processing system, in particular, a system oriented for handheld devices, a request is rising more and more for enhancing a camera capability, concretely, increasing the number of pixels of a still image and improving processing performance of a moving image. On the other hand, another request is also rising more and more for enhancing a function density per one chip. Since both of the requests are to be balanced, for ameliorating the camera capability, a circuit area cannot be increased without considering the enhancement of the function density for one chip.
In the image treatment of the conventional multimedia processing system, for performing image processing such as gamma correction, color space conversion, and pixel interpolation with respect to Bayer data sent from a CCD (Charge Coupled Device) or CMOS (Complementary Metal Oxide Semiconductor) sensor, the Bayer data is read in blocks or lines.
The description will be oriented to the image processing apparatus which is arranged to read data in blocks.
FIG. 15 illustrates the data reading sequence in the conventional block read. FIG. 16 is a block diagram showing the conventional processing circuit for reading the blocks. When reading the blocks, Bayer data 800 for one image is divided into blocks 801, each of which is made up of the predetermined number of pixels in the horizontal and the vertical directions, and is read in sequence block by block. In the illustration, the data is read in the sequence of block numbers, that is, in the sequence from the block 1 located in the upper left toward the right hand, that is, the block 1, the block 2, the block 3, . . . as shown in FIG. 15. In this data read, for processing an image in pixels, the data is read as securing a predetermined overlapped area.
In the block-by-block reading and processing circuit, the Bayer data is read block by block in the foregoing block sequence through a system bus 901a and then is temporarily stored in a block buffer 0 (902a) or a block buffer 1 (902b). A selector 903 serves to select data saved in one buffer and then output the selected data to a color processor 904 for processing an image. For enhancing the processing efficiency, the data is written in the other buffer that is not connected with the color processor 904 through the system bus 901a. The color processor 904 executes the image processing with the input pixel data and then outputs the processed data through the system bus 901b. 
In turn, the description will be oriented to the image processing apparatus which is arranged to read data in lines. FIG. 17 illustrates the data reading sequence in the conventional process of reading data in lines. FIG. 18 is a block diagram showing the conventional line-by-line reading and processing circuit. In the line-by-line reading process, the Bayer data 800 is read in sequence on one horizontal line unit 810.
The line-by-line reading and processing circuit is arranged to read the Bayer data line by line in sequence from the top to the bottom and then to temporarily save the line data in a line buffer 905. The line buffer 905 has a capability of storing the required number of lines for image processing in the color processor 904. The color processor 904 executes the image processing with respect to the pixel data stored in the line buffer 905 and then outputs the processed data through the system bus 901b. 
With respect to the line-by-line reading process, there has been proposed an image processing apparatus which is arranged to divide original image data that is more than the storage capacity (readable horizontal pixels) of the line memory into the data corresponding to the storage capacity of the line memory and the remaining data that is overflowed from the line memory. (For example, refer to Japanese Unexamined Patent Publication No. 2002-252749 (paragraph numbers [0021] to [0029] and FIG. 2).)
However, the conventional block-by-block or line-by-line reading process has difficulty in enhancing the function of the image processing without increasing the circuit scale. Concretely, the block-by-block reading process makes it possible to suppress a block size of an input buffer included in the color processor, thereby reducing the mounting area. As a disadvantage, however, this type of reading process increases the times of accessing a frame buffer in which an input image and an output image are stored and needs a longer processing time accordingly. Hence, as the pixels composing an image to be processed become more and more, the processing time is likely to be longer and longer. For example, a long time is taken in the process from when a shutter of a camera is depressed to when an image is processed to when the processed image data is stored in a storage medium. As another disadvantage, this reading process is not fitted for a moving image that requires fast processing.
Turning to the line-by-line reading process, this process involves so great a burst effect caused in reading or writing data in or from the frame buffer that it may shorten the processing time. However, this process needs to have some full-line-sized buffers as the input buffer of the color processor. This disadvantageously results in making the mounting area larger. Hence, as the pixels composing an image to be processed become more and more, the mounting area is made larger and larger. This larger mounting area becomes an obstacle to making the resulting product small and lightweight. In particular, this line-by-line reading process is not practically fitted for such a handheld device as a mobile phone or a digital camera that is likely to be smaller and more lightweight.
Further, in a case that the original image data that is larger than the storage capacity of the line memory is divided into the data area for the storage capacity of the line memory and the remaining data area overflowed from the storage capacity thereof when processing the original image data, the area for the line memory capacity is not matched in size to the overflowed area. This brings about a disadvantage of making switching of parameters such as a size complicated. Further, since the original image data is divided into those two areas when processing the image data, it is necessary to secure the storage capacity of the line memory for a half of an estimated line at minimum. As another disadvantage, this method does not cope with the image composed of a larger number of pixels.